S1_genreate_a_series_of_files(){
 for index in {1..100}; do
     filename="/tmp/new_file${index}"
     printf '%s' "{index}" > "${filename}"
 done
}
S2_list_4_files_in_long_format_about_account_and_group(){
 ls -ld /etc/{passwd,group,shadow,gshadow} | sort
}
S3_find_items_related_to_given_username(){
 grep "^$1:" /etc/{passwd,shadow} | sort
}
S4_find_items_related_to_given_group-name(){
 grep "^$1:" /etc/{group,gshadow} | sort
}
S5_create_groups_for_given_group_names(){
 groupadd rnd
 groupadd itoperation
}
S6_create_users_and_set_their_group_as_required(){
for user in Adam Bob Calvin David Edward; do
    useradd -m "$user"
    if [[ "$user" =~ ^(Adam|Bob|Edward)$ ]]; then
        usermod -aG rnd "$user"
    elif [[ "$user" =~ ^(Calvin|David)$ ]]; then
        usermod -aG itoperation "$user"
    fi
 done
}
S7_change_users_shell(){
usermod -s /usr/bin/sh Adam
usermod -s /usr/bin/sh Edward
}
S8_set_passworf_change_policy(){
 for user in Adam Bob Calvin Edward; do
     chage -M 60 -m 10 -W "$user"
 done
}
S9_set_password_for_five_users(){
#!/bin/bash
 password=("$@")
 usernames=("Adam" "Bob" "Calvin" "Edward")

 echo -e "${usernames[0]}:${passwords[0]}\n${usernames[1]}:${passwords[1]}\n${usernames[2]}:${passwords[2]}\n${usernames[3]}:${passwords[3]}\n${usernames
}:${passwords[4]}" | chpasswd

}
S10_lock_bobs_password(){
 usermod -L Bob
}
S11_include_adam_into_wheel_group(){
 usermod -aG wheel Adam
}
S12_change_files_permission(){
 for ((i=3; i<=100; i+=3)) do
     filename="/tmp/new_file${i}"
     chmod 640 "$filename"
 done
}
